#include <stdio.h>
struct student{
	char xh[10];
	char name[10];
	int a,b,c;
};
int main(){
	int n,max=0,s4,t;
	scanf("%d",&n);
	struct student p[n];
	for(int i=0;i<n;i++){
		scanf("%s%s%d%d%d",&p[i].xh,&p[i].name,&p[i].a,&p[i].b,&p[i].c);
	s4=p[i].a+p[i].b+p[i].c;
	if(s4>max){
		max=s4;t=i;
	} 
	}
	printf("%s %s %d",p[t].name,p[t].xh,max);
	
	
	return 0;
}
